package com.wuzhiming.istudy.mapper;

import com.wuzhiming.istudy.pojo.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @ClassName: UserMapper
 * @Description: 用户mapper
 * @Author:zhimingw
 * @Version 1.0
 * @since 2022/3/16 19:01
 */
@Mapper
public interface UserMapper {
    /**
     * @Description: 查询单条数据
     * @Param: [id]
     * @return: top.zhimingw.pojo.Admin
     * @Author: zhimingw
     * @Date: 2021/5/30
     */
    User queryById(Integer id);


    /**
    * @Description: 用于用户登录
    * @Param: [id]
    * @return: com.wuzhiming.istudy.pojo.User
    * @Author: zhimingw
    * @Date: 2022/3/16
    */
    User queryByName(String name);

    /**
    * @Description: 查询用户
    * @Param: [user]
    * @return: com.wuzhiming.istudy.pojo.User
    * @Author: zhimingw
    * @Date: 2022/3/23
    */
    User queryUser(User user);

    /**
    * @Description: 添加用户
    * @Param: [name, password]
    * @return: int
    * @Author: zhimingw
    * @Date: 2022/3/23
    */
    int insertUser(String name,String password);


    /**
    * @Description: 修改User,根据 user 的主键修改数据
    * @Param: [user]
    * @return: int
    * @Author: zhimingw
    * @Date: 2022/3/28
    */
    int update(User user);
    
    /**
    * @Description: 查询所有用户
    * @Param: []
    * @return: java.util.List<com.wuzhiming.istudy.pojo.User>
    * @Author: zhimingw
    * @Date: 2022/3/31
    */
    List<User> queryAll();
}
